package pio.action;

import java.io.File;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.struts.action.ActionForm;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.actions.DownloadAction;

public class DescargarCVS extends DownloadAction{

    protected StreamInfo getStreamInfo(ActionMapping mapping, 
                                       ActionForm form,
                                       HttpServletRequest request, 
                                       HttpServletResponse response)
            throws Exception {
        // Download a "pdf" file - gets the file name from the
        // Action Mapping's parameter
        String contentType = "application/cvs";
        //System.out.println("");
        File file          = new File(String.valueOf(request.getSession().getAttribute("reporte")));
        return new FileStreamInfo(contentType, file);   
    }
}